#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>

void rotate(int* nums, int numsSize, int k) {
    int T[10] = { 0 };
    int j = 0;
    int m = numsSize - k;
    int n = 0;
    for (int i = 0; i < numsSize; ++i) {
        if (i < k) {
            T[n++] = nums[m++];
        }
        else
            T[n++] = nums[j++];
    }
    memcpy(nums, T, sizeof(T[0]) * numsSize);
}

int main()
{
    int nums[10] = { 1,2,3,4,5,6,7 ,'\0'};
    int k = 3;
    int len = 7;
    rotate(nums, len, k);
    return 0;
}